﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using MySql.Data;
using MySql.Data.MySqlClient;

namespace Genealogy_Builder
{
    public partial class Connect : Form
    {
        private bool cancelled;

        public Connect()
        {
            InitializeComponent();

        }

        public void PrepConnectionString()
        {
            cancelled = true;
        }

        public string GetConnectionString()
        {
            if (cancelled)
            {
                return null;
            }
            else
            {
                return "server=" + hostTxt.Text + ";user=" + usernameTxt.Text + ";database=" + databaseTxt.Text + ";port=" + portTxt.Text + ";password=" + passwordTxt.Text;
            }
        }

        private void cancelBtn_Click(object sender, EventArgs e)
        {
            cancelled = true;
            this.Close();
        }

        private void submitBtn_Click(object sender, EventArgs e)
        {
            cancelled = false;
            this.Close();
        }

        private void hostTxt_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void Connect_Load(object sender, EventArgs e)
        {

        }
    }
}
